package com.storeroompda.utils;

import android.view.animation.Interpolator;


/**
 * Created by dell on 2018/8/7.
 * 设置弹性动画
 */

public class SpringScaleInterpolator implements Interpolator {


    private float x;

    public SpringScaleInterpolator(float factor) {
        this.x = factor;

    }

    @Override
    public float getInterpolation(float input) {
        return  (float) (Math.pow(2, -10 * input) * Math.sin((input - x / 4) * (2 * Math.PI) / x) + 1);
    }
}
